Micron Document
๐ŸŽ–๏ธGitะฏั€ะฐ๐ŸŽ–๏ธ

Commit 65320ab7f99c54587184918808f0ee699fc73967


Parents : 47134f4
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-06-13T06:33:48-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-06-13T06:33:48-05:00

build: drop compiler flags and opt-ins made redundant by Kotlin 2.4 (#5786)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Changes
Diff

diff --git a/.agent_memory/session_context.archive.md b/.agent_memory/session_context.archive.md
index bea22b59c1..325475706d 100644
--- a/.agent_memory/session_context.archive.md
+++ b/.agent_memory/session_context.archive.md
@@ -1,6 +1,12 @@
# Agent Session Context โ€” ARCHIVE
# Older handover entries rotated out of session_context.md. Not read by default.
# Consult only if you need historical detail on a specific past change.
+## 2026-05-21 โ€” Upgraded Chirpy to a fully-personalized Live Diagnostic Node & Mesh Assistant
+- Integrated `NodeRepository` into `GeminiNanoDocAssistant.kt` and the Google AI Koin dependency injection module (`GoogleAiModule.kt`).
+- Developed a dynamic live-state prompt formatting block within `buildPrompt(...)` that queries current hardware model, firmware version, connection status, GPS capability, channel utilization, airtime, battery level/voltage, user profile long/short names, and total registered mesh peer counts & active online peers directly from `NodeRepository`'s reactive flows.
+- Injected this live radio diagnostics context dynamically as a system instruction metadata block on every user query. This empowers the on-device model to answer real-time, personalized diagnostic questions (e.g. "what is my battery level?", "how many active nodes are on my mesh right now?") with 100% on-device offline accuracy.
+- Tuned context retrieval constraints for the modern `nano-v4-full` (Gemini Nano v4) model: expanded the total context budget `MAX_CONTEXT_CHARS` from 8,000 to **32,000 characters** (up to ~12K tokens out of the model's native 32K window), and scaled `MAX_PAGE_CHARS` to **16,000 characters** and `MAX_SNIPPET_CHARS` to **8,000 characters** to supply vastly richer, more detailed, and complete documentation fragments.
+
## 2026-05-21 โ€” Activated full on-device token streaming and polished Chirpy's personality instructions
- Upgraded the on-device inference flow inside `GeminiNanoDocAssistant.kt` to use Firebase AI SDK's reactive `generateContentStream(prompt)` instead of the blocking `generateContent` invocation.

diff --git a/.agent_memory/session_context.md b/.agent_memory/session_context.md
index d133856798..db5c3df7fd 100644
--- a/.agent_memory/session_context.md
+++ b/.agent_memory/session_context.md
@@ -6,6 +6,12 @@
# the oldest entries to `session_context.archive.md` (not read by default). The
# "Golden Context" block at the bottom is stable across sessions; keep it here.
+## 2026-06-12 โ€” Kotlin 2.4 flag/opt-in cleanup (PR #5786)
+- Kotlin 2.4.0 toolchain landed on main via Renovate #5760 (kotlin 2.4.0, mokkery 3.4.1, koin-plugin 1.0.1) + kable 0.43.1 (#5750).
+- PR #5786 (branch claude/modest-carson-f0c5c6) removes what 2.4 made redundant: build-logic SHARED_COMPILER_ARGS drops `-opt-in=kotlin.uuid.ExperimentalUuidApi` (Uuid.random/parse stable; only generateV4/V7 still experimental, unused), `-opt-in=kotlin.time.ExperimentalTime` (Clock/Instant stable since 2.3, no still-experimental time API used), `-Xcontext-parameters` (stable), `-Xannotation-default-target=param-property` (compiler reported redundant, ~34 warnings/build); ComposeCompilerConfiguration drops deprecated `ComposeFeatureFlag.OptimizeNonSkippingGroups` (default behavior, flag removed in Kotlin 2.6). Also stripped per-file @OptIn(ExperimentalUuidApi) from 7 files.
+- Verified twice with full baseline + kmpSmokeCompile (1706 tasks, 2756 tests, 0 failures); no warnings referencing removed flags, no new annotation-target warnings.
+- Remaining 2.4 adoption candidates (not in this PR): explicit backing fields for the ~96 `_state`/`asStateFlow` pairs (wait for IDE 2026.1.4 support), `@IntroducedAt` for meshtastic-sdk binary compat, Swift export alpha for the iOS goal. Also still TODO: drop kotlin<2.4 renovate holds in MQTTastic + protobufs.
+
## 2026-06-12 โ€” Fixed flaky NodeTest.isOnline_usesStrictThresholdBoundary (wall-clock race)
- PR #5779 (targeting main): the test read the clock twice โ€” `onlineTimeThreshold()` once for its expected value, then again inside the `isOnline` getter; a one-second wall-clock tick between reads turned the strict-boundary assertion into `N+1 > N+1` = false. Seen failing on loaded CI in #5760's shard-core (jvm + androidHostTest).
- Fix: internal `Node.isOnline(threshold: Int)` overload; the public `isOnline` property delegates to it. Test pins one threshold for both construction and check, keeping the strict `>` boundary assertion (no slop widening).
@@ -30,11 +36,6 @@
- Made teardown resilient with `if (::manager.isInitialized) manager.close()` so setup/early failures do not cascade into teardown crashes.
- Verified with `:core:database:jvmTest --tests "org.meshtastic.core.database.DatabaseManagerWithDbRetryTest*"` and repeated it 5 consecutive runs without failures; `:core:database:detekt` also passed.
-## 2026-05-21 โ€” Upgraded Chirpy to a fully-personalized Live Diagnostic Node & Mesh Assistant
-- Integrated `NodeRepository` into `GeminiNanoDocAssistant.kt` and the Google AI Koin dependency injection module (`GoogleAiModule.kt`).
-- Developed a dynamic live-state prompt formatting block within `buildPrompt(...)` that queries current hardware model, firmware version, connection status, GPS capability, channel utilization, airtime, battery level/voltage, user profile long/short names, and total registered mesh peer counts & active online peers directly from `NodeRepository`'s reactive flows.
-- Injected this live radio diagnostics context dynamically as a system instruction metadata block on every user query. This empowers the on-device model to answer real-time, personalized diagnostic questions (e.g. "what is my battery level?", "how many active nodes are on my mesh right now?") with 100% on-device offline accuracy.
-- Tuned context retrieval constraints for the modern `nano-v4-full` (Gemini Nano v4) model: expanded the total context budget `MAX_CONTEXT_CHARS` from 8,000 to **32,000 characters** (up to ~12K tokens out of the model's native 32K window), and scaled `MAX_PAGE_CHARS` to **16,000 characters** and `MAX_SNIPPET_CHARS` to **8,000 characters** to supply vastly richer, more detailed, and complete documentation fragments.
## Golden Context (stable across sessions)
- Always check `.skills/compose-ui/strings-index.txt` before reading `strings.xml`.

diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ComposeCompilerConfiguration.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ComposeCompilerConfiguration.kt
index db0ee17002..5f396e2bac 100644
--- a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ComposeCompilerConfiguration.kt
+++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ComposeCompilerConfiguration.kt
@@ -20,7 +20,6 @@ import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.configure
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
-import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
internal fun Project.configureComposeCompiler() {
extensions.configure<ComposeCompilerGradlePluginExtension> {
@@ -40,6 +39,5 @@ internal fun Project.configureComposeCompiler() {
.relativeToRootProject("compose-reports")
.let(reportsDestination::set)
stabilityConfigurationFiles.add(isolated.rootProject.projectDirectory.file("compose_compiler_config.conf"))
- featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups)
}
}

diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt
index 3a5f819091..5e65c2dfb5 100644
--- a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt
+++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt
@@ -228,11 +228,7 @@ private val PUBLISHED_MODULES = setOf("api", "model", "proto")
/** Compiler args shared across all Kotlin targets (JVM, Android, iOS, etc.). */
private val SHARED_COMPILER_ARGS =
listOf(
- "-opt-in=kotlin.uuid.ExperimentalUuidApi",
- "-opt-in=kotlin.time.ExperimentalTime",
"-Xexpect-actual-classes",
- "-Xcontext-parameters",
- "-Xannotation-default-target=param-property",
"-Xskip-prerelease-check",
"-Xbackend-threads=0",
)

diff --git a/core/datastore/src/commonTest/kotlin/org/meshtastic/core/datastore/RecentAddressesDataSourceTest.kt b/core/datastore/src/commonTest/kotlin/org/meshtastic/core/datastore/RecentAddressesDataSourceTest.kt
index 17c03fded4..dd44052d29 100644
--- a/core/datastore/src/commonTest/kotlin/org/meshtastic/core/datastore/RecentAddressesDataSourceTest.kt
+++ b/core/datastore/src/commonTest/kotlin/org/meshtastic/core/datastore/RecentAddressesDataSourceTest.kt
@@ -39,10 +39,8 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
-@OptIn(ExperimentalUuidApi::class)
class RecentAddressesDataSourceTest {
private lateinit var tmpDir: Path
private lateinit var dataSource: RecentAddressesDataSource

diff --git a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/filter/FilterPrefsTest.kt b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/filter/FilterPrefsTest.kt
index 74d1600827..4c96488e1a 100644
--- a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/filter/FilterPrefsTest.kt
+++ b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/filter/FilterPrefsTest.kt
@@ -32,10 +32,8 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
-@OptIn(ExperimentalUuidApi::class)
class FilterPrefsTest {
private lateinit var tmpDir: Path

diff --git a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/notification/NotificationPrefsTest.kt b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/notification/NotificationPrefsTest.kt
index a5792e8004..b628e10105 100644
--- a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/notification/NotificationPrefsTest.kt
+++ b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/notification/NotificationPrefsTest.kt
@@ -31,10 +31,8 @@ import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
-@OptIn(ExperimentalUuidApi::class)
class NotificationPrefsTest {
private lateinit var tmpDir: Path

diff --git a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/tak/TakPrefsTest.kt b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/tak/TakPrefsTest.kt
index 2ad0ad21cd..cc2ecdd415 100644
--- a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/tak/TakPrefsTest.kt
+++ b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/tak/TakPrefsTest.kt
@@ -31,10 +31,8 @@ import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
-@OptIn(ExperimentalUuidApi::class)
class TakPrefsTest {
private lateinit var tmpDir: Path

diff --git a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/ui/NodeListLayoutPrefsTest.kt b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/ui/NodeListLayoutPrefsTest.kt
index c642dca9f5..73c35891fc 100644
--- a/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/ui/NodeListLayoutPrefsTest.kt
+++ b/core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/ui/NodeListLayoutPrefsTest.kt
@@ -32,10 +32,8 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
-@OptIn(ExperimentalUuidApi::class)
class NodeListLayoutPrefsTest {
private lateinit var tmpDir: Path
private lateinit var dataStore: DataStore<Preferences>

diff --git a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt
index d6e32c1513..af2769bb3b 100644
--- a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt
+++ b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt
@@ -81,7 +81,6 @@ import org.meshtastic.feature.settings.navigation.ConfigRoute
import org.meshtastic.feature.settings.navigation.getNavRouteFrom
import org.meshtastic.feature.settings.radio.RadioConfigViewModel
import org.meshtastic.feature.settings.radio.component.PacketResponseStateDialog
-import kotlin.uuid.ExperimentalUuidApi
/**
* Fixed minimum height for the "connected device" card at the top of the Connections screen. Shared across the three UI
@@ -91,7 +90,7 @@ import kotlin.uuid.ExperimentalUuidApi
private val CardMinHeight = 100.dp
/** Composable screen for managing device connections (BLE, TCP, USB). It displays connection status. */
-@OptIn(ExperimentalMaterial3Api::class, ExperimentalUuidApi::class)
+@OptIn(ExperimentalMaterial3Api::class)
@Suppress("CyclomaticComplexMethod", "LongMethod", "MagicNumber", "ModifierMissing", "ComposableParamOrder")
@Composable
fun ConnectionsScreen(

diff --git a/feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/navigation/DocsNavigation.kt b/feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/navigation/DocsNavigation.kt
index 4e95d3b505..a396702ba0 100644
--- a/feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/navigation/DocsNavigation.kt
+++ b/feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/navigation/DocsNavigation.kt
@@ -64,12 +64,11 @@ import org.meshtastic.feature.docs.translation.DocTranslationService
import org.meshtastic.feature.docs.translation.TranslationResult
import org.meshtastic.feature.docs.ui.DocsBrowserScreen
import org.meshtastic.feature.docs.ui.DocsPageRouteScreen
-import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
import org.meshtastic.core.resources.Res as CoreRes
/** Registers docs navigation entries into the Settings navigation graph. */
-@OptIn(ExperimentalUuidApi::class, ExperimentalMaterial3AdaptiveApi::class)
+@OptIn(ExperimentalMaterial3AdaptiveApi::class)
fun EntryProviderScope<NavKey>.docsEntries(backStack: NavBackStack<NavKey>) {
entry<SettingsRoute.HelpDocs>(metadata = { ListDetailSceneStrategy.listPane() }) {
val hasDetailSelected = remember(backStack) { backStack.any { it is SettingsRoute.HelpDocPage } }
@@ -99,7 +98,6 @@ class ChirpyUiState(
val onNavigateToPage: (String) -> Unit,
)
-@OptIn(ExperimentalUuidApi::class)
@Composable
private fun rememberChirpyState(
backStack: NavBackStack<NavKey>,
@@ -208,7 +206,6 @@ private fun rememberChirpyState(
)
}
-@OptIn(ExperimentalUuidApi::class)
@Composable
private fun AutoIntroduceChirpy(
showSheet: Boolean,
@@ -384,7 +381,6 @@ private const val CHIRPY_INTRO_PROMPT =
"Do not give the user a nickname. Be punchy and fun."
/** Maps an [AIDocAssistantResult] to a [ChirpyMessage]. */
-@OptIn(ExperimentalUuidApi::class)
private suspend fun chirpyResultToMessage(result: AIDocAssistantResult): ChirpyMessage = when (result) {
is AIDocAssistantResult.Partial ->
ChirpyMessage(

Served by rngit 1.5.0 - Generated in 0.16s